﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using hospital_registration_system.BLL;
using hospital_registration_system.Entity;

namespace hospital_registration_system.Utility
{
    /// <summary>
    /// 管理员管理就诊时间功能
    /// </summary>
    public class ManagerClinic_Time
    {
        protected static Clinic_TimeService service = new Clinic_TimeService();
        /// <summary>
        /// 设置新的就诊时间
        /// </summary>
        /// <param name="time">就诊时间</param>
        /// <returns>执行信息</returns>
        public static string setClinicTime(Clinic_time time)
        {
            if (service.updateClinic_time(time))
            {
                return "设置时间为" + time.See_time;
            }
            else
            {
                return "设置失败";
            }
        }

        /// <summary>
        /// 返回所有的就诊时间
        /// </summary>
        /// <returns>查询到的就诊时间</returns>
        public static List<Clinic_time> getAllClinicTime()
        {
            return service.selectAllClinic_time();
        }

        /// <summary>
        /// 添加就诊时间
        /// </summary>
        /// <param name="doctor_id">医生的id</param>
        /// <returns>执行信息</returns>
        public static string newClinicTime(int id,DateTime time,int see_time)
        {
            if(service.insertClinic_time(id, time, see_time))
            {
                return "成功";
            }
            return "失败";
        }

        /// <summary>
        /// 删除就诊时间
        /// </summary>
        /// <param name="id">要删除的id</param>
        /// <returns>执行信息</returns>
        public static string delClinicTime(int id)
        {
            if (service.deleteClinic_timeById(id))
            {
                return "成功";
            }
            return "失败";
        }
    }
}
